<!DOCTYPE html>
<html>
	<head>
	<meta charset="utf-8" />
			<!--限制1：1不能缩放-->
	<meta content="width=device-width,initial-scale=1.0,maximum-scale=1.0,user-scalable=no" id="viewport" name="viewport">
		<title>选择车型</title>
	
	<script src="http://cdn.bootcss.com/jquery/1.9.1/jquery.min.js"></script>
	<script src="http://carnt.carnettong.com:8088/CARNT/js/cookie.js"></script>
		<!--bootstrap-->
	<link rel="stylesheet" type="text/css" href="./bootstrap.min.css"/>
	<script src="./bootstrap.min.js" type="text/javascript" charset="utf-8"></script>
	<link rel="stylesheet" href="//g.alicdn.com/msui/sm/0.6.2/css/sm.min.css" class="">
	<link rel="stylesheet" type="text/css" href="./all.css"/>
	<link rel="stylesheet" type="text/css" href="./baoyang.css"/>
	</head>
	<style type="text/css">
		body{
			position: relative;
			overflow:scroll;
		}
.carKind .col-xs-12 p {
    display: block;
    margin-bottom: 0;
    margin-left: 5px;
    padding: 10px 5px;
}
	</style>
	<style>
	header h2 {
    color: white;
    font-size: 0.88em;
    margin-top: 10px;
    text-align: center;
}
header{height:40px;line-height:40px;}
	</style>
	<body>
	    <div id="headers" style="background:#e42e3b"></div>
		<header style="background:#e42e3b;border-bottom:1px solid #EFEFEF;height:44px;line-height:44px;">
		  <a class="button button-link button-nav pull-left back" style="border:0;text-decoration: none;line-height:44px;font-size:0.8rem;color:#fff;height:44px;" href="javascript:;" id="goBacks">
            <span class="icon icon-left" style="color:#fff"></span>
             	选择车型
          </a>
		</header>
		<div class="content carKind" data-spy="scroll" data-target="#navbar-example">
			<h2 id = "name"></h2>
				<div class="row">
					<!--<div class="col-xs-12">
						<p>玛莎拉蒂</p>
					</div>
				--></div>
		</div>
		<script type="text/javascript">
		//var getIp = 'http://4scafe.carnettong.com';// 双胜
        var getIp = 'http://carnt.carnettong.com:8088';// 线上
        function GetQueryString(name){
			var reg = new RegExp("(^|&)"+ name +"=([^&]*)(&|$)");
			var r = window.location.search.substr(1).match(reg);
			if(r!=null)return  unescape(r[2]); return null;
		}
		var carBrandName = getCookie('carBrandName');
		var isIOSApp=sessionStorage.getItem("isIOSApp");
		$("#name").text(carBrandName);
	    if(isIOSApp){
			$("#headers").css("padding","10px");
	    }else{
	   		$("#headers").css("padding","0px");
	    }
	    $("#goBacks").on("click",function(){
	        location.href="./carBrand.html";
	    })
		function toCarModel(carSetName){
	         window.location.href="./carModel.html?carSetName="+carSetName;
	         setCookie('carSetName',carSetName);
        }
    
		$(function(){
		    //给车品牌赋值
		  //   $.ajax({
			 //    type:"get",
				// dataType:"json",
				// url:getIp+"/CARNT/card/listCardSet.action?CAR_BRAND="+encodeURI(carBrandName),
				// success:function(data) {
				//     $("#name").text(data.carBrandName);
		  //       }
	   //      })
	        
	        //加载车系列表
			$.ajax({
			    type:"get",
				dataType:"json",
				data:{ CAR_BRAND:encodeURI(carBrandName)},
				url:getIp+"/CARNT/card/listCardSet.action",
				success:function(data) {
				    var html = "";
				    var datas=data.CARSET;
					$.each(datas,function(index,e) {
						var carSetName=datas[index].CARDSET;
						html += "<div class=\"col-xs-12\" onclick=\"toCarModel('"+carSetName+"')\">";
						html += "<p>"+carSetName+"</p>";
						html += "</div>";
					})
					$('.row').html(html);
		        }
	        })
		 })		
		 </script>	
	</body>
</html>
